# -*- coding: utf-8 -*-
import xlwt


#样式参数，最后一个参数就是颜色
ststyle = xlwt.easyxf('pattern: pattern solid, fore_colour ice_blue')#开始时间
jtstyle = xlwt.easyxf('pattern: pattern solid, fore_colour red')#结束时间
datestyle = xlwt.easyxf('pattern: pattern solid, fore_colour green')#事件
shistyle = xlwt.easyxf('pattern: pattern solid, fore_colour orange')#周几

def build():
    x=0
    y=0
    data=xlwt.Workbook(encoding="UTF-8")
    mysheet=data.add_sheet("杨苏苏的作息时间表")
    week=["周一","周二","周三","周四","周五","周六","周日"]
    w=0
    mysheet.write(x,y,week[0],datestyle)
    while True:
        print("今天为：",week[w])
        print("请选择你要进行的操作")
        a=int(input("1：进入下一天   2：继续编辑本天   3：退出创建\r\n"))
        if(a==1):
            x=0
            y=y+3
            if(w==6):
                w=0
            else:
                w=w+1
            mysheet.write(x,y,week[w],datestyle)
            
        elif(a==2):
            stime=input("请输入开始时间：")
            jtime=input("请输入结束时间：")
            shi=input("请输入事件详情：")
            mysheet.write(x+1,y,stime,ststyle)
            mysheet.write(x+1,y+1,jtime,jtstyle)
            mysheet.write(x+1,y+2,shi,shistyle)
            x=x+1
        elif(a==3):
            break
    data.save("作息时间表.xls")
    return 0


build()
##def zbuilt():
##    return 0
